/*
============================================================================
 Name        : BlockJBM.h
 Author      : \x{738b}\x{658c}
 Version     :
 Copyright   : \x{76ca}\x{76df}\x{8f6f}\x{4ef6}
 Description : CBlockJBM declaration
============================================================================
*/

#ifndef BlockJBM_H
#define BlockJBM_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include "BlockGoods.h"
#include "Flickable.h"
// CLASS DECLARATION

/**
*  CBlockJBM
* 
*/
class CBlockJBM  : public CBlockGoods, public MFlickableCallback
{
public:
	~CBlockJBM();

	static CBlockJBM* NewL(CBaseBlock* bsBack);

	static CBlockJBM* NewLC(CBaseBlock* bsBack);

	CBlockJBM(CBaseBlock* bsBack);

private:
	void ConstructL();

public:
	//from CBlock
	void OnDraw(CFbsBitGc& g)const;

	void OnKeyDown(TInt keyCode);

	void OnInput(const TDesC8& strInput);

	TInt32 GetMenuItem();

	void InitData();

	TBool ReadData(const TDesC8& aData);

	void WriteData(TDes8& aBuf);

	TInt GetDataLength();

	TInt16 GetDataType();
	
	void SizeChanged();

	void ChangeScrollPos(TInt nPos);
    
    void OnMouseDown(const TPoint& aPt);

    void OnMouseMove(const TPoint& aPt);

    void OnMouseUp(const TPoint& aPt);
	
public:
    // from MFlickableCallback
    virtual TPoint ScrollOffset() const;

    virtual void SetScrollOffset(const TPoint& aOffset);
	
protected:
	void AddTabs();

private:
	TInt m_nStart;
	CDesCArray* m_pstrFieldName;
	XInt32 m_pxJBM[13];
	CDesCArray* m_vFHSP;
	

    TInt iOffset;
    TInt iHeight;
    CFlickable* iFlickable;
    TRect iListRect;

    mutable TInt iStartItem;
    mutable TInt iEndItem;
};

#endif // BlockJBM_H
